//
//  ByClassTableViewCell.m
//  LiangYa_BObject
//
//  Created by dllo on 15/10/28.
//  Copyright © 2015年 YuHao. All rights reserved.
//

#import "ByClassTableViewCell.h"

@implementation ByClassTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.redV = [[UIView alloc] init];
        _redV.backgroundColor = [UIColor redColor];
        _redV.hidden = YES;
        [self.contentView addSubview:_redV];
        
        self.nameL = [[NightLabel alloc] init];
        _nameL.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_nameL];
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    _redV.frame = CGRectMake(0, 0, 3, cellHeight);
    _nameL.frame = self.bounds;
    
    self.layer.borderColor = [[UIColor colorWithRed:230/255.0 green:230/255.0 blue:230/255.0 alpha:1] CGColor];
    self.layer.borderWidth = 1;
    self.backgroundColor = [UIColor clearColor];
    
    if (_nameL.textColor != [UIColor redColor]) {
        
        if ([[NSUserDefaults standardUserDefaults]boolForKey:@"nightstyle"]) {
            _nameL.textColor = [UIColor whiteColor];
        }else{
            _nameL.textColor = [UIColor blackColor];
        }
    }
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
